package com.demo02_interaction.client;

import com.demo02_interaction.bean.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "user-service", path = "/api/internal/users", fallbackFactory = UserServiceClientFallbackFactory.class)
public interface UserServiceClient {
    
    @GetMapping("/{userId}")
    UserDTO getUserById(@PathVariable("userId") Long userId);
    
    @GetMapping("/{userId}/exists")
    Boolean checkUserExists(@PathVariable("userId") Long userId);
}
